const wxEnv = wx.getAccountInfoSync().miniProgram.envVersion
// 针对不同生产环境判断
const envData = {
    develop: {
        env: 'development',
        // https://test.51zidan.com/testnewcrm
        // baseUrl: 'http://192.168.1.151:8188'
        // baseUrl: 'http://192.168.1.108:8188'
        // baseUrl: 'http://192.168.110.230:8188'
        // baseUrl: 'http://192.168.110.120:8188'
        // baseUrl: 'http://192.168.1.222:8188'
        // baseUrl: 'http://192.168.1.133:8188'
        // baseUrl: "http://192.168.1.151:8188"
        // baseUrl: 'http://192.168.110.188:8188'
        baseUrl: 'https://test.51zidan.com/testnewcrm'
        // baseUrl: 'https://test.51zidan.com/testcrm'
        // baseUrl: 'http://192.168.110.120:8188'
    },
    trial: {
        env: 'trial',
        // baseUrl: 'https://test.51zidan.com/testnewcrm'
        baseUrl: 'http://192.168.110.230:8188'
    },
    release: {
        env: 'production',
        baseUrl: 'https://test.51zidan.com/testcrm'
    }
}
// export const development = {
//     env: 'development',
//     // https://test.51zidan.com/testnewcrm
//     // baseUrl: 'http://192.168.1.151:8188'
//     // baseUrl: 'http://192.168.1.108:8188'
//     // baseUrl: 'http://192.168.1.230:8188'
//     // baseUrl: 'http://192.168.1.222:8188'
//     // baseUrl: 'http://192.168.1.133:8188'
//     // baseUrl: "http://192.168.1.151:8188"
//     // baseUrl: 'http://192.168.1.133:8188'
//     baseUrl: 'https://test.51zidan.com/testnewcrm'
//     //   baseUrl: 'https://test.51zidan.com/testcrm'
// }
// const production = {
//     env: 'production',
//     baseUrl: 'https://test.51zidan.com/testcrm'
//     // baseUrl: 'https://test.51zidan.com/testnewcrm'
// }

// // 不同环境赋值
// if (process.env.NODE_ENV === 'development') {
//     console.log('当前开发环境')
//     envData = development
// } else {
//     console.log('当前生产环境')
//     envData = production
// }

console.log(wxEnv, envData[wxEnv])

const platform = 'wechat'
const appId = 'wx139adaeea32b1618'

const defaultShareMsg = {
    title: '子弹crm',
    path: '/pages/index/index',
    imageUrl: '/static/common/common/share.png'
}

const config = {
    token: '',
    menuTop: uni.getMenuButtonBoundingClientRect().top,
    menuHeight: uni.getMenuButtonBoundingClientRect().height
}

export default {
    platform,
    appId,
    ...envData[wxEnv], // 注入不同环境的变量
    defaultShareMsg,
    ...config
}
